home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1997-01-28 | 14.8 KB | 537 lines |
- 10 'COPWIRE : 15 DEC 85 rev. 27 SEP 96
- 20 IF EX$=""THEN EX$="EXIT"
- 30 CLS:KEY OFF
- 40 COLOR 7,0,1
- 50 PI=3.14159
- 60 UL$=STRING$(80,205) 'underline
- 70 ER$=STRING$(80,32) 'erase
- 80 U$="####.###"
- 90 V$="####.####"
- 100 DIM A(50,4) 'AWG sizes (American Wire Gauge)
- 110 DIM B(50,4) 'BSWG sizes (British Standard Wire Gauge)
- 120 '
- 130 '.....AWG wire sizes
- 140 ' AWG system: Geometrical progression of 39 wire sizes from #0000 AWG
- 150 ' to #36 AWG.
- 160 ' #0000 = 0.4600" dia. (maximum)
- 170 ' #36 = 0.005" dia. (minimum)
- 180 ' Number of sizes = 39 (eventually extended to 50)
- 190 K#= (0.46/0.005)^(1/39) 'incremental multiplier
- 200 ' n = AWG gauge# + 3 (to allow for sizes #0, 00, 000 and 0000)
- 210 ' Wire diameter = 0.46 <UNK! {00F6}> K#^n
- 220 FOR Z=1 TO 50
- 230 N=Z+3
- 240 WIRE=0.46/K#^N 'wire diameter in inches
- 250 ' DC resistance per metre = 1/(<0xE3!>a<UNK! {FDEB}>) where:
- 260 ' a = radius of wire in metres
- 270 ' conductivity of copper * = 5.8 * 10^7 mho/m
- 280 A=WIRE/2 'wire radius
- 290 OHM=304.8/(58*PI*(A*25.4)^2) 'ohms per 1000 feet
- 300 '.....alternate calculation for ohms/1000 ft.
- 310 '.....CM=(WIRE*10^3)^2 'circular mils
- 320 '.....OHM=10,371/CM 'ohms per 1000 feet
- 330 A(Z,1)=WIRE
- 340 A(Z,2)=OHM
- 350 NEXT Z
- 360 '
- 370 '.....BSWG wire sizes
- 380 WIRE=0.324 'initial diameter
- 390 FOR Z=1 TO 50
- 400 IF Z<=3 THEN WIRE =WIRE-0.024:GOTO 530
- 410 IF Z<=6 THEN WIRE =WIRE-0.02:GOTO 530
- 420 IF Z<=10 THEN WIRE =WIRE-0.016:GOTO 530
- 430 IF Z<=14 THEN WIRE =WIRE-0.012:GOTO 530
- 440 IF Z<=19 THEN WIRE =WIRE-0.008:GOTO 530
- 450 IF Z<=23 THEN WIRE =WIRE-0.004:GOTO 530
- 460 IF Z<=26 THEN WIRE =WIRE-0.002:GOTO 530
- 470 IF Z<=28 THEN WIRE =WIRE-0.0016:GOTO 530
- 480 IF Z<=30 THEN WIRE =WIRE-0.0012:GOTO 530
- 490 IF Z<=39 THEN WIRE =WIRE-0.000799999:GOTO 530
- 500 IF Z<=49 THEN WIRE =WIRE-0.000399998:GOTO 530
- 510 WIRE=WIRE-0.000199999
- 520 '
- 530 B(Z,1)=WIRE
- 540 CIRC=(WIRE*10^3)^2 'circular mils
- 550 A=WIRE/2
- 560 OHM=304.8/(58*PI*(A*25.4)^2) 'resistance per 1000 feet
- 570 B(Z,2)=OHM
- 580 NEXT Z
- 590 '
- 600 '.....current in air
- 610 DATA 73,55,41,32,22,16,11
- 620 '.....current in cable
- 630 DATA 46,33,23,17,13,10,7.5,5
- 640 '
- 650 FOR Z=8 TO 20 STEP 2:READ A(Z,3):NEXT Z 'current in air
- 660 FOR Z=8 TO 22 STEP 2:READ A(Z,4):NEXT Z 'current in cable/bundles
- 670 '
- 680 '.....start
- 690 CLS
- 700 COLOR 15,2
- 710 PRINT" COPPER WIRE";TAB(57);"by George Murphy VE3ERP ";
- 720 COLOR 1,0:PRINT STRING$(80,223);
- 730 COLOR 7,0
- 740 PRINT " Press number in < > to choose standard units of measure:"
- 750 PRINT UL$;
- 760 PRINT " < 1 > Metric"
- 770 PRINT " < 2 > U.S.A./Imperial"
- 780 PRINT UL$;
- 790 PRINT " or press <0> to EXIT....."
- 800 Z$=INKEY$
- 810 IF Z$="0"THEN CLS:RUN EX$
- 820 IF Z$="1"THEN UM=25.4:UM$="mm.":GOTO 850
- 830 IF Z$="2"THEN UM=1:UM$="in.":GOTO 850
- 840 GOTO 800
- 850 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 860 GOSUB 4970
- 870 PRINT UL$;
- 880 PRINT " Press letter in < > for......"
- 890 PRINT UL$;
- 900 PRINT " < a > Copper wire table - metric/inch/AWG"
- 910 PRINT " < b > Copper wire table - metric/inch/BSWG"
- 920 PRINT " < c > Current carrying capacity of AWG sizes of copper wire"
- 930 PRINT " < d > DC resistance of copper wire"
- 940 PRINT " < e > RF resistance of copper wire"
- 950 PRINT " < f > Voltage drop in long wire runs"
- 960 PRINT " < g > Weight of copper wire"
- 970 PRINT " < h > Wire size conversions - metric/inch/AWG"
- 980 Z$=INKEY$
- 990 IF Z$="a"THEN GA$="A.W.G.":GOTO 1980
- 1000 IF Z$="b"THEN GA$="B.S.W.G.":GOTO 1980
- 1010 IF Z$="c"THEN 1690
- 1020 IF Z$="d"THEN 4100
- 1030 IF Z$="e"THEN 3450
- 1040 IF Z$="f"THEN 1150
- 1050 IF Z$="g"THEN 2860
- 1060 IF Z$="h"THEN 2640
- 1070 GOTO 980
- 1080 '
- 1090 '.....display input
- 1100 LOCATE CSRLIN-1:PRINT STRING$(7,32)
- 1110 LOCATE CSRLIN-1,39:PRINT STRING$(40,32)
- 1120 LOCATE CSRLIN-1,39:PRINT ".......";USING U$;Q;
- 1130 RETURN
- 1140 '
- 1150 '.....voltage drop
- 1160 CLS
- 1170 IF UM=1 THEN M=1:M$="ft."ELSE M=0.3048:M$="m."
- 1180 H$=" VOLTAGE DROP IN COPPER WIRE CONDUCTOR"
- 1190 COLOR 15,2
- 1200 PRINT H$;
- 1210 PRINT TAB(57);"by George Murphy VE3ERP ";
- 1220 COLOR 1,0:PRINT STRING$(80,223);
- 1230 COLOR 7,0
- 1240 PRINT " ENTER: Length of wire.........(";M$;")";:INPUT L:L=L/M
- 1250 IF L=0 THEN LOCATE CSRLIN-1:PRINT STRING$(78,32):LOCATE CSRLIN-1:GOTO 1240
- 1260 LG=INT(L*10*M+0.5)/10
- 1270 INPUT " ENTER: Current...............(amps)";I
- 1280 IF I=0 THEN LOCATE CSRLIN-1:PRINT STRING$(78,32):LOCATE CSRLIN-1:GOTO 1270
- 1290 INPUT " ENTER: Circular mils per amp (if applicable)...";CMA
- 1300 VIEW PRINT 3 TO 23:CLS:VIEW PRINT
- 1310 COLOR 2,2:LOCATE 1,1:PRINT STRING$(80,32);
- 1320 COLOR 15,2
- 1330 LOCATE 1,1:PRINT H$;LG;M$;" long @";I;"amp ";
- 1340 COLOR 7,0
- 1350 LOCATE 3
- 1360 FOR Z=1 TO 40
- 1370 CM=(A(Z,1)*1000)^2 'circular mils
- 1380 R=A(Z,2)/1000*L 'ohms/1000 ft.
- 1390 E=I*R 'voltage drop
- 1400 C=I*CMA:IF CM>=C THEN W=Z 'CMA = CM per amp.
- 1410 IF CM<C THEN COLOR 0,7 ELSE COLOR 7,0
- 1420 IF Z/2<>INT(Z/2)THEN LOCATE CSRLIN,1 ELSE LOCATE CSRLIN-1,42
- 1430 PRINT " #";
- 1440 IF Z<10 THEN PRINT " ";
- 1450 PRINT Z;"AWG";
- 1460 Z$="#####.####"
- 1470 IF R>=10 THEN Z$="######.###"
- 1480 IF R>=10^2 THEN Z$="#######.##"
- 1490 IF R>=10^3 THEN Z$="########.#"
- 1500 PRINT USING Z$;R;:PRINT " -";
- 1510 Z$="#####.####"
- 1520 IF E>=10 THEN Z$="######.###"
- 1530 IF E>=10^2 THEN Z$="#######.##"
- 1540 IF E>=10^3 THEN Z$="########.#"
- 1550 PRINT USING Z$;E;:PRINT " v."
- 1560 NEXT Z
- 1570 COLOR 7,0:PRINT UL$;
- 1580 FOR Z=2 TO 22:LOCATE Z,41:PRINT "OPEN":NEXT Z 'print vertical bar
- 1590 LOCATE 23,41:PRINT CHR$(202)
- 1600 PRINT " -= resistance of";LG;M$;" of wire,";
- 1610 PRINT " v.= voltage drop in";LG;M$;" of wire";
- 1620 IF W=40 THEN 1660
- 1630 COLOR 0,7:LOCATE 23,3
- 1640 PRINT" Current exceeds";CMA;"CM per amp capacity of wires smaller than";
- 1650 PRINT" AWG";W;
- 1660 COLOR 7,0
- 1670 GOTO 5190
- 1680 '
- 1690 '.....current carrying capacity
- 1700 CLS
- 1710 COLOR 15,2
- 1720 PRINT" CONTINUOUS-DUTY CAPACITY OF COPPER WIRE in AMPERES";
- 1730 PRINT TAB(57)"by George Murphy VE3ERP ";
- 1740 COLOR 1,0:PRINT STRING$(80,223);
- 1750 COLOR 7,0
- 1760 PRINT " Wire Size Ohms/Mft. ";
- 1770 PRINT " Single Bunched Chassis 500 cmA 700 cmA 1000 cmA"
- 1780 PRINT UL$;
- 1790 FOR Z=10 TO 40 STEP 2
- 1800 PRINT " ";Z;" AWG";
- 1810 PRINT USING "######.###";A(Z,2);
- 1820 IF A(Z,3)=0 THEN PRINT " - ";:GOTO 1840
- 1830 PRINT USING "#######.#";A(Z,3);
- 1840 IF A(Z,4)=0 THEN PRINT " - ";:GOTO 1860
- 1850 PRINT USING "#######.#";A(Z,4);
- 1860 CM=(A(Z,1)*1000)^2
- 1870 PRINT USING "#######.##";CM/250;
- 1880 PRINT USING "#######.##";CM/550;
- 1890 PRINT USING "#######.##";CM/700;
- 1900 PRINT USING "#######.##";CM/1000
- 1910 NEXT Z
- 1920 PRINT" <Single> = Single wire in open air (e.g. power transmission line)."
- 1930 PRINT" <Bunched>= Wires or cables in conduits or bundles."
- 1940 PRINT" <Chassis>= Short point-to-point & general chassis wiring (250 cmA)."
- 1950 PRINT" <cmA> = Circular mils per amp.(used in transformer design).";
- 1960 GOTO 5190
- 1970 '
- 1980 '.....wire table
- 1990 CLS
- 2000 COLOR 15,2
- 2010 PRINT " COPPER WIRE TABLE - ";GA$;" SIZES";
- 2020 PRINT TAB(57);"by George Murphy VE3ERP ";
- 2030 COLOR 1,0:PRINT STRING$(80,223);
- 2040 COLOR 7,0
- 2050 '
- 2060 FOR N=1 TO 40
- 2070 T=2:L=CSRLIN
- 2080 IF N/2=INT(N/2)THEN T=43:L=CSRLIN-1
- 2090 LOCATE L,T
- 2100 PRINT "#";USING "###";N;
- 2110 IF UM<>1 THEN 2330 ELSE 2130
- 2120 '
- 2130 '.....USA/IMPERIAL table
- 2140 IF GA$="A.W.G."THEN WIRE=A(N,1)ELSE WIRE=B(N,1)
- 2150 PRINT " ";CHR$(237);USING ".####";WIRE;
- 2160 PRINT CHR$(34);
- 2170 CM=(WIRE*10^3)^2
- 2180 Z$="####,###"
- 2190 IF CM<10^4 THEN Z$="######.#"
- 2200 IF CM<10^3 THEN Z$="#####.##"
- 2210 IF CM<10^2 THEN Z$="####.###"
- 2220 IF CM<10 THEN Z$="###.####"
- 2230 PRINT USING Z$;CM;:PRINT " ^m";
- 2240 IF GA$="A.W.G."THEN OHM=A(N,2)ELSE OHM=B(N,2)
- 2250 Z$="####.####"
- 2260 IF OHM>=10 THEN Z$="#####.###"
- 2270 IF OHM>=10^2 THEN Z$="######.##"
- 2280 IF OHM>=10^3 THEN Z$="#######.#"
- 2290 PRINT USING Z$;OHM;
- 2300 PRINT " ";CHR$(234);"M"
- 2310 GOTO 2480
- 2320 '
- 2330 '.....Metric table
- 2340 IF GA$="A.W.G."THEN WIRE=A(N,1)ELSE WIRE=B(N,1)
- 2350 PRINT " ";CHR$(237);USING "#.###";WIRE*UM;
- 2360 AR=(WIRE*UM/2)^2*PI
- 2370 Z$="#####.##":IF AR<10 THEN Z$="####.###"
- 2380 PRINT USING Z$;AR;:PRINT " mm<UNK! {FD22}>;
- 2390 IF GA$="A.W.G."THEN OHM=A(N,2)ELSE OHM=B(N,2)
- 2400 Z$="####.####"
- 2410 IF OHM/0.3048>=10 THEN Z$="#####.###"
- 2420 IF OHM/0.3048>=10^2 THEN Z$="######.##"
- 2430 IF OHM/0.3048>=10^3 THEN Z$="#######.#"
- 2440 PRINT USING Z$;OHM/0.3048;
- 2450 PRINT " -km"
- 2460 GOTO 2480
- 2470 '
- 2480 NEXT N
- 2490 '
- 2500 PRINT UL$;
- 2510 FOR Z=2 TO 22:LOCATE Z,41:PRINT CHR$(186):NEXT Z
- 2520 LOCATE 23,41:PRINT CHR$(202)
- 2530 IF UM=1 THEN 2590
- 2540 PRINT " ^ = Diameter (mm)";
- 2550 PRINT TAB(30);"mm<UNK! {FD20}>= cross-section area";
- 2560 PRINT TAB(67);"-km = Ohms/km";
- 2570 GOTO 2620
- 2580 '
- 2590 PRINT " ^ = Diameter (in.)";
- 2600 PRINT TAB(23);"^m=Circular Mils (wire diameter * 1000)";CHR$(253);
- 2610 PRINT TAB(65);CHR$(234);"M = Ohms/M ft.";
- 2620 GOTO 5190
- 2630 '
- 2640 '.....calculate size or gauge
- 2650 CLS
- 2660 COLOR 15,2
- 2670 PRINT " SOLID COPPER WIRE SIZES";
- 2680 PRINT TAB(57);"by George Murphy VE3ERP ";
- 2690 COLOR 1,0:PRINT STRING$(80,223);
- 2700 COLOR 7,0
- 2710 IF UM=1 THEN STD=1:GOTO 4490 ELSE STD=2:GOTO 2730
- 2720 '
- 2730 '.....metric wire sizes
- 2740 COLOR 15,2
- 2750 PRINT " METRIC:";
- 2760 COLOR 0,7
- 2770 PRINT " Press (1) to enter diameter,(2) to enter X-section area,";
- 2780 PRINT "(0) to quit..."
- 2790 COLOR 7,0
- 2800 Z$=INKEY$
- 2810 IF Z$="0"THEN LOCATE CSRLIN-1:PRINT ER$;:GOTO 5190
- 2820 IF Z$="1"THEN 4330
- 2830 IF Z$="2"THEN 4410
- 2840 GOTO 2800
- 2850 '
- 2860 '.....weight of copper wire
- 2870 CLS
- 2880 COLOR 15,2
- 2890 PRINT " WEIGHT OF SOLID COPPER WIRE";TAB(57);"by George Murphy VE3ERP ";
- 2900 COLOR 1,0:PRINT STRING$(80,223);
- 2910 COLOR 7,0
- 2920 PRINT " Press number in < > to choose unit of measurement of wire size:"
- 2930 PRINT UL$;
- 2940 PRINT " < 1 > AWG gauge #"
- 2950 PRINT " < 2 > Diameter in inches"
- 2960 PRINT " < 3 > Diameter in millimetres"
- 2970 PRINT UL$;
- 2980 W$=INKEY$
- 2990 IF W$="1"THEN SZ$="AWG #":D$=" AWG":GOTO 3030
- 3000 IF W$="2"THEN SZ$="dia. in inches":D$=CHR$(34)+" dia.":GOTO 3030
- 3010 IF W$="3"THEN SZ$="dia. in mm.":D$="mm dia.":GOTO 3030
- 3020 GOTO 2980
- 3030 PRINT " ENTER: Wire ";SZ$;"......";:INPUT X
- 3040 IF W$="1"THEN 3080
- 3050 IF W$="2"THEN R=X/2:GOTO 3130
- 3060 IF W$="3"THEN R=X/25.4/2:GOTO 3130
- 3070 '
- 3080 FOR Z=1 TO 40
- 3090 IF Z=X THEN 3110
- 3100 NEXT Z
- 3110 R=A(Z,1)/2 'radius
- 3120 '
- 3130 AR=PI*R^2 'cross-section area
- 3140 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 3150 PRINT " Press number in < > to choose unit of measurement of wire length:"
- 3160 PRINT UL$;
- 3170 PRINT " < 1 > Feet"
- 3180 PRINT " < 2 > Metres"
- 3190 PRINT UL$;
- 3200 L$=INKEY$
- 3210 IF L$="1"THEN LG$="feet":GOTO 3240
- 3220 IF L$="2"THEN LG$="metres":GOTO 3240
- 3230 GOTO 3200
- 3240 PRINT " ENTER: Length of wire in ";LG$;"........";:INPUT L
- 3250 IF L$="1"THEN LG=L*12:GOTO 3270
- 3260 IF L$="2"THEN LG=L*3.048*12:GOTO 3270
- 3270 CU=AR*LG 'cubic inches of wire
- 3280 PCI=0.321 'weight of 1 cubic inch of copper
- 3290 WLB=CU*PCI 'weight in pounds
- 3300 LGLB=L/WLB 'length units per pound
- 3310 WKG=CU*PCI/2.2 'weight in kilograms
- 3320 LGKG=L/WKG 'length units per kilogram
- 3330 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 3340 IF D$=" AWG"THEN Y$=" #"ELSE Y$=""
- 3350 PRINT " Weight of";L;LG$;" of";Y$;STR$(X);D$;" bare copper wire:";
- 3360 PRINT TAB(55);USING "###.##";WLB;:PRINT " lb."
- 3370 PRINT TAB(55);USING "###.##";WKG;:PRINT " Kg."
- 3380 PRINT UL$;
- 3390 PRINT " Base weight:";
- 3400 PRINT TAB(14);USING "##,###.#";LGLB;:PRINT " ";LG$;:PRINT "/lb."
- 3410 PRINT TAB(14);USING "##,###.#";LGKG;:PRINT " ";LG$;:PRINT "/Kg."
- 3420 PRINT UL$;
- 3430 GOTO 5190
- 3440 '
- 3450 '.....RF resistance
- 3460 CLS
- 3470 COLOR 15,2
- 3480 PRINT " RF Resistance of Copper Wire";TAB(57);"by George Murphy VE3ERP ";
- 3490 COLOR 1,0:PRINT STRING$(80,223);
- 3500 COLOR 7,0
- 3510 U=1 'permeability of copper
- 3520 UO=4*PI*10^-7 'permeability for vacuum in Henry per metre
- 3530 D=5.8*10^7 'conductivity of copper in mho/metre
- 3540 '
- 3550 PRINT " Press number in < > to choose method of entering wire size";
- 3560 PRINT UL$;
- 3570 PRINT " < 1 > Diameter in millimetres"
- 3580 PRINT " < 2 > Diameter in decimal inches"
- 3590 PRINT " < 3 > Diameter in AWG gauge"
- 3600 Z$=INKEY$:IF Z$=""THEN 3600
- 3610 IF Z$="1"THEN Z$="mm.":GOTO 3650
- 3620 IF Z$="2"THEN Z$="in.":GOTO 3650
- 3630 IF Z$="3"THEN Z$="AWG":GOTO 3650
- 3640 GOTO 3600
- 3650 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 3660 PRINT " Diameter of wire.............(";Z$;")";:INPUT Z
- 3670 IF Z$="mm."THEN MM=Z
- 3680 IF Z$="in."THEN MM=Z*25.4
- 3690 IF Z$="AWG"THEN MM=A(Z,1)*25.4
- 3700 LOCATE CSRLIN-1,31:PRINT USING V$;MM;:PRINT " mm =";USING V$;MM/25.4;
- 3710 PRINT " in.";
- 3720 IF Z$="AWG"THEN PRINT " (#";Z;Z$;")" ELSE PRINT ""
- 3730 A=MM/2/10^3 '1/2 dia. of wire in metres
- 3740 '
- 3750 IF UM$="mm."THEN Z$=" m." ELSE Z$="ft."
- 3760 PRINT " Length of wire...............(";Z$;")";:INPUT L
- 3770 IF UM$="in."THEN L=L*0.3048
- 3780 LOCATE CSRLIN-1,31:PRINT USING V$;L;:PRINT " m. =";USING V$;L/0.3048;
- 3790 PRINT " ft."
- 3800 '
- 3810 INPUT " Frequency....................(MHz)";FZ
- 3820 LOCATE CSRLIN-1,31:PRINT USING V$;FZ;:PRINT " MHz"
- 3830 F=FZ*10^6
- 3840 '
- 3850 RDC=L*1/(PI*A^2*D)
- 3860 PRINT " DC resistance................";USING V$;RDC;:PRINT " -"
- 3870 '
- 3880 W=2*PI*F
- 3890 RE=L*1/(2*PI*A)*SQR(W*U*UO/(2*D))
- 3900 PRINT " Reactance....................";USING V$;RE;:PRINT " -"
- 3910 PRINT " RF surface resistance........";USING V$;RE;:PRINT " -";
- 3920 PRINT " (same value as reactance)"
- 3930 '
- 3940 DS=SQR(2/(U*UO*W*D))*10^3
- 3950 PRINT " RF Penetration depth.........";USING V$;DS;:PRINT " mm =";
- 3960 PRINT USING V$;DS/25.4;:PRINT " in."
- 3970 PRINT UL$;
- 3980 LOCATE 15
- 3990 T=9
- 4000 PRINT TAB(T);
- 4010 PRINT "Program suggested by GNEWran Hosinsky, EA8YU, using formulae by"
- 4020 PRINT TAB(T);
- 4030 PRINT "SM0AQW in an article in QTC 1996 no.2, from original material"
- 4040 PRINT TAB(T);
- 4050 PRINT "published in Fundamental Electromagnetic Theory, by Ronald King"
- 4060 PRINT TAB(T);
- 4070 PRINT "(Dover Publications Inc.)"
- 4080 GOTO 5190
- 4090 '
- 4100 '.....DC resistance
- 4110 CLS
- 4120 COLOR 15,2
- 4130 PRINT " DC Resistance of Copper Wire";TAB(57);"by George Murphy VE3ERP ";
- 4140 COLOR 1,0:PRINT STRING$(80,223);
- 4150 COLOR 7,0
- 4160 PRINT " ENTER: Wire diameter..........(";UM$;")";:INPUT D
- 4170 IF UM=1 THEN D=D*25.4
- 4180 LOCATE CSRLIN-1
- 4190 PRINT " Wire diameter..........";USING V$;D;
- 4200 PRINT " mm. =";USING V$;D/25.4;:PRINT " in."
- 4210 PRINT " ENTER: Wire length............(";UM$;")";:INPUT L
- 4220 IF UM=1 THEN L=L*25.4
- 4230 LOCATE CSRLIN-1
- 4240 IF L<1000 THEN M$=" mm. =":Z=L:ELSE M$=" m. =":Z=L/10^3
- 4250 PRINT " Wire length............";USING V$;Z;:PRINT M$;
- 4260 IF L/25.4<100 THEN M$=" in.":Z=L/25.4:ELSE M$=" ft.":Z=L/304.8
- 4270 PRINT USING V$;Z;:PRINT M$
- 4280 A=D/2 'radius of wire
- 4290 R=L/10^3/(PI*A^2*58)
- 4300 PRINT " Resistance.............";USING V$;R;:PRINT " ohms"
- 4310 GOTO 5190
- 4320 ,
- 4330 '.....metric wire diameter
- 4340 LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
- 4350 COLOR 0,7:INPUT " ENTER: Diameter of wire (mm) ";M
- 4360 COLOR 7,0
- 4370 LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
- 4380 W=M/25.4
- 4390 GOTO 4580
- 4400 '
- 4410 '.....metric wire cross section area
- 4420 LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
- 4430 COLOR 0,7:INPUT " ENTER: Cross-section area of wire (mm<UNK! {FD29}> ";A
- 4440 COLOR 7,0
- 4450 LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
- 4460 W=SQR(A/PI)*2/25.4
- 4470 GOTO 4580
- 4480 '
- 4490 '.....AWG & decimal wire sizes
- 4500 COLOR 0,7
- 4510 INPUT" ENTER: AWG Gauge #, or Dia.in decimal inches, or 0 to quit..";W
- 4520 COLOR 7,0
- 4530 IF W=0 THEN LOCATE CSRLIN-1:PRINT ER$;:GOTO 5190
- 4540 LOCATE CSRLIN-1
- 4550 PRINT ER$;
- 4560 LOCATE CSRLIN-1
- 4570 '
- 4580 IF(W>0.3)AND(W<1)THEN BEEP:GOTO 4500
- 4590 IF W<1 THEN 4660
- 4600 GA=W
- 4610 GOSUB 4830 'print line
- 4620 PRINT UL$;
- 4630 IF STD=1 THEN 4490
- 4640 IF STD=2 THEN 2730
- 4650 '
- 4660 FOR Z=40 TO 1 STEP-1
- 4670 IF A(Z,1)>=W THEN GA=Z:GOTO 4690
- 4680 NEXT Z
- 4690 GOSUB 4830
- 4700 COLOR 15,2
- 4710 PRINT " SOUGHT DIAMETER: ";USING ".####";W;
- 4720 DI=W:GOSUB 4880
- 4730 COLOR 7,0
- 4740 FOR Z=1 TO 40
- 4750 IF A(Z,1)<W THEN GA=Z:GOTO 4770
- 4760 NEXT Z
- 4770 GOSUB 4830
- 4780 COLOR 7,0
- 4790 PRINT UL$;
- 4800 IF STD=1 THEN 4500
- 4810 IF STD=2 THEN 2730
- 4820 '
- 4830 '.....display wire table
- 4840 PRINT " AWG #";USING "##";GA;
- 4850 DI=A(GA,1)
- 4860 PRINT TAB(23);USING ".####";DI;
- 4870 '
- 4880 PRINT CHR$(34);" dia.";
- 4890 CM=(DI*1000)^2
- 4900 PRINT USING "###,###";CM;
- 4910 PRINT " c.m. ( ";
- 4920 PRINT USING "#.##";DI*25.4;
- 4930 PRINT " mm dia.";USING "####.##";(DI*25.4/2)^2*PI;
- 4940 PRINT " mm";CHR$(253);" area )";
- 4950 RETURN
- 4960 '
- 4970 '.....preface
- 4980 T=8
- 4990 PRINT TAB(T);
- 5000 PRINT "Most of the values produced by this program are computed from"
- 5010 PRINT TAB(T);
- 5020 PRINT "basic equations to a precision of 7 significant figures, with no"
- 5030 PRINT TAB(T);
- 5040 PRINT "rounding off anywhere in the calculations except in the final"
- 5050 PRINT TAB(T);
- 5060 PRINT "screen display. Most long-established published tables consist of"
- 5070 PRINT TAB(T);
- 5080 PRINT "values that may have been rounded-off during chained calculations."
- 5090 PRINT TAB(T);
- 5100 PRINT "The resulting final truncated pubished values may not be as precise"
- 5110 PRINT TAB(T);
- 5120 PRINT "those produced by a computer. Because of this, you may find that"
- 5130 PRINT TAB(T);
- 5140 PRINT "HAMCALC calculations may not always agree to the last decimal place"
- 5150 PRINT TAB(T);
- 5160 PRINT "with our cherished handbooks!"
- 5170 RETURN
- 5180 '
- 5190 '.....end
- 5200 GOSUB 5240
- 5210 GOTO 680
- 5220 END
- 5230 '
- 5240 'HARDCOPY
- 5250 GOSUB 5360:LOCATE 25,2:COLOR 14,6
- 5260 PRINT " Press 1 to print screen, 2 to print screen & ";
- 5270 PRINT "advance paper, or 3 to continue.";:COLOR 7,0
- 5280 Z$=INKEY$:IF Z$="3"THEN GOSUB 5360:RETURN
- 5290 IF Z$="1"OR Z$="2"THEN GOSUB 5360:GOTO 5310
- 5300 GOTO 5280
- 5310 FOR QX=1 TO 24:FOR QY=1 TO 80
- 5320 LPRINT CHR$(SCREEN(QX,QY));
- 5330 NEXT QY:NEXT QX
- 5340 IF Z$="2"THEN LPRINT CHR$(12)
- 5350 GOTO 5250
- 5360 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
-